home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Singles Flirt Up Your Life! (German)
/
Singles Flirt Up Your Life.iso
/
data1.cab
/
Statemachine
/
questErotic1.lua
< prev
next >
Wrap
Text File
|
2004-01-29
|
2KB
|
80 lines
beginStateMachine()
-- called when questor builds up all known questScripts
onEnter(function(msg)
print("questErotic1 entered");
setState("initial");
end )
-- on game over: relationship conditions get reset to 0 and all quests are reset to initial
onMsg("questreset", function(msg)
--getParent().getParent().getCharacter(MIKE).decRelationshipCondition(ELAINE, REL_EROTIC,1);
--getParent().getParent().getCharacter(ELAINE).decRelationshipCondition(MIKE, REL_EROTIC,1);
setState("initial");
end )
---------------------------------------------------------------------------------------------------------------------------------------
state("initial")
onMsg("checkCondition", function(msg)
-- check if questRomance1 has already started
--if getParent().questRomance1.getState() ~= "initial" then
-- setState("done");
--end
local mike = getParent().getParent().getCharacter(MIKE);
local elaine = getParent().getParent().getCharacter(ELAINE);
if ( -- condition here
----------------
min( mike.getRelationshipCondition(ELAINE, REL_EROTIC),
elaine.getRelationshipCondition(MIKE, REL_EROTIC)) >= 1)
----------------
then
-- go to talk position
mike.queueCommand("pm_talkCutscene", "talkCutscene", elaine , "questErotic1");
setState("talktome");
end
end )
state("talktome")
-- as soon as arrived - start dialog (interaction.talkCutscene sends talking)
onMsg("talking", function(msg)
if ( msg.data == "questErotic1" ) then
popupConversation("dialogErotic1");
setState("donetalktome");
end
end )
onMsg("talkingCancelled", function(msg)
if ( msg.data == "questErotic1" ) then
print("--------------------> talktome onMsg talkingCancelled " .. msg.data);
setState("done");
end
end )
state("donetalktome")
-- last dialog box clicked away
onMsg("yes", function(msg)
-- cancel
local mike = getParent().getParent().getCharacter(MIKE);
local elaine = getParent().getParent().getCharacter(ELAINE);
mike.cancelCurrentActivity();
elaine.cancelCurrentActivity();
setState("done");
end )
---------------------------------------------------------------------------------------------------------------------------------------
state("done")
-- sackgasse hier
endStateMachine()